1. Field of the Invention
This invention relates to a focus sensor using phase-differential detection for an imaging device, which uses an image sensing element, of a digital camera or the like, a method of sensing focus by using phase-differential detection and a computer-readable storage medium for such method.
2. Description of Related Art
A large number of focus sensors that rely upon phase-differential detection are available as auto focus devices used in traditional single-lens reflex silver-halide cameras.
FIG. 19 is a sectional view showing a single-lens reflex camera having such a focus sensor using phase-differential detection according to the prior art. A ray bundle 109a emergent from a taking lens 100 is split into a ray bundle 109b by reflection at a main mirror 102 comprising half-mirror and a ray bundle 109e obtained by transmission through the main mirror 102. The reflected ray bundle 109b forms the image of a subject on the diffusing surface of a focusing plate 103. The photographer is capable of observing the image of the subject on the focusing plate 103 via eyepieces 105a, 105b and a pentagonal prism 104.
The ray bundle 109e obtained by transmission through the main mirror 102 is reflected by a sub mirror 106 and introduced to a focus sensor 107. The latter senses the state of focus (the amount of defocusing) of the taking lens 100 with respect to a silver-salt emulsion film 108 by a ray bundle 109f from the taking lens 100.
If it is determined that the amount of defocusing sensed is greater than a predetermined range of focuses and is indicative of a defocused state, a focusing lens of the taking lens 100 is driven so as to eliminate the amount of sensed defocusing, whereby focusing is achieved.
Focus sensing processing in the conventional focus sensor will be described with reference to FIGS. 20A to 20C and FIGS. 21A to 21C. FIG. 20A illustrates the in-focus state. Here ray bundles 116a, 116b that have passed through two different pupils of the taking lens 100 form an image on a primary imaging plane 114, and the subject image on the primary imaging plane is formed again on a sensor plane 113 on which two line sensors 113a, 113b are disposed, by secondary image forming lenses 112a, 112b, respectively. A field lens 111 is placed in the vicinity of the primary imaging plane 114 of the taking lens 100 and introduces a pencil of rays of a prescribed image height to the sensor plane in an efficient manner to prevent a decline in quantity of light caused by an increase in image height.
In general, diaphragms (not shown) are placed directly in front of or directly in back of the secondary image forming lenses 112a, 112b to limit the two ray bundles 116a, 116b that have passed through the different pupils of the taking lens 100. The taking lens 100 does not possess a member for pupil partitioning.
Since the two images formed on the line sensors 113a, 113b are the result of ray bundles that have passed through different pupils, the relative positions of the images differ depending upon the amount of lens movement and result in an in-focus state, front-focused state or rear-focused state, as illustrated in FIGS. 20A to 20C and FIGS. 21A to 21C.
In FIGS. 20A and 21A, the spacing between the two images formed on the line sensors 113a, 113b in the in-focus state is equal to the relative distance e0 between the two line sensors and is constant at all times in the in-focus state.
In FIGS. 20B and 21B, spacing e1 between the two images is less than e0 in the front-focused state where the amount of defocusing is d1. If the defocusing amount d1 is increased, a difference δ1 between e0 and e1 also increases.
In FIGS. 20C and 21C, spacing e2 between the two images is greater than e0 in the rear-focused state where the amount of defocusing is d2. If the defocusing amount d2 is increased, a difference δ2 between e2 and e0 also increases.
Thus, the amount of defocusing and the direction thereof can be determined from the spacing between the two images. The difference between the two images in the currently defocused state and the reference spacing e0 in the in-focus state, namely the amount of relative shift (phase difference) between the two images given by δ=e−e0, is calculated by obtaining the correlation between the output signals of the two line sensors 113a, 113b. The amount defocusing of the optical system and the direction of this defocusing are found from the phase difference and the focusing lens is controlled accordingly to achieve the in-focus state.
When this auto focus scheme is used in an image sensing device that employs an image sensing element for photography in a video camera or digital camera as disclosed in the specification of Japanese Patent Application Laid-Open No. 9-43507, there is no need to provide a light-receiving sensor for phase-difference detection, as in the above-mentioned silver-halide camera, and the image sensing element can be used as the light-receiving sensor for auto3507, there is no need to provide a light-receiving sensor for phase-difference detection, as in the above-mentioned silver-halide camera, and the image sensing element can be used as the light-receiving sensor for auto focus.
If the image sensing element is for black and white, the output of the element is the luminance signal representing the image of the received light. No problems arise, therefore, since the output obtained is similar to that of the auto focus sensor for the aforesaid silver-halide camera. However, if image sensing elements are for color, luminance signals classified according to prescribed color components are output from respective ones of the image sensing elements. Consequently, depending upon the color of the subject imaged, it is not possible to detect the phase difference of the image of the received light.
Further, if the image sensing element for taking pictures is used also as a li if image sensing elements are for color, luminance signals for color, luminance signals classified according to prescribed color components are output from respective ones of the image sensing elements. Consequently, depending upon the color of the subject imaged, it is not possible to detect the phase difference of the image of the received light.
Further, if the image sensing element for taking pictures is used also as a light-receiving sensor for detection of phase difference, the output of the image sensing element is subjected to prescribed image processing such as a gamma correction to obtain an image signal for photography. Consequently, if it is attempted to detect phase difference using the image signal to which such processing has been applied, auto focus speed slows down because such processing takes time.